package com.etc.proxy;

/**
 * 静态代理
 */
interface IMan {
    public void setName(String name);

    public String getName();

    public void qq();

    public void mm();
}

/**
 * 代理类
 */
public class Man implements IMan {
    String name;

    public void setName(String name) {
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public void qq() {
        System.out.println("QQ");
    }

    public void mm() {
        System.out.println("QQ");
    }
}

/**
 * 被代理的人
 */
class  Proxy implements IMan{
    private IMan man = new Man();

    public void setName(String name)
    {
        man.setName("xx");
    }

    public String getName(){

        return "";
    }

    public void qq(){
        man.qq();
    }

    public void mm()
    {
        man.mm();
    }
}

class TestMain{
    public static void main(String[] args) {
        Proxy proxy = new Proxy();
        proxy.mm();
        proxy.qq();;
    }

}
